package com.qf.cloud2204.microa.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.concurrent.TimeUnit;

@RestController
@RequestMapping("/a")
@Slf4j
public class TestController {

    @Value("${server.port}")
    private Integer port;

    @GetMapping("/hello")
    public String hello(){

        // 模拟执行时长为 10 s
//        try {
//            TimeUnit.SECONDS.sleep(10);
//        } catch (InterruptedException e) {
//            e.printStackTrace();
//        }
        System.out.println("开始处理请求/hello");
        log.debug("开始处理请求/hello");
        return "hello spring cloud from prot :"+port;
    }

}
